package com.dinglian.ots.common;

import com.dinglian.ots.redis.RedisService;
import com.dinglian.ots.redis.SessionKey;
import com.dinglian.ots.redis.UserKey;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import java.util.Iterator;
import java.util.Set;

/**
 * @author wangbo
 */
@Component
public class StartService implements ApplicationRunner {

    @Autowired
    private RedisService redisService;

    @Override
    public void run(ApplicationArguments args) throws Exception {
       /* Set<String> keys = redisService.keys(UserKey.getKey,"*");
        Iterator<String> it = keys.iterator();
        while(it.hasNext()) {
            String keyStr = it.next();
            redisService.delete(keyStr);
        }*/
    }
}
